package com.danco.training.zaneuskaya.api;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.danco.training.zaneuskaya.domain.Book;
import com.danco.training.zaneuskaya.domain.Order;

public interface OrderService extends EntityService<Order>, Serializable {

	public List<Order> getExecutedOrders(List<Order> orders);

	public List<Order> getNotExecutedOrders(List<Order> orders);

	public List<Order> getExecutedOrdersForPeriod(List<Order> orders,
			Date from, Date to);

	public List<Order> sortOrdersByOrderDate(List<Order> orders);

	public List<Order> sortOrdersByTotalPrice(List<Order> orders);

	public List<Order> sortOrdersByOrderState(List<Order> orders);

	public List<Order> sortExecutedOrdersByOrderDate(List<Order> orders,
			Date from, Date to);

	public List<Order> sortExecutedOrdersByPrice(List<Order> orders, Date from,
			Date to);

	public boolean addBookToOrder(Order order, Book book);

	public boolean removeBookFromOrder(Order order, Book book);

	public double countPrice(Order order);

	public Order createOrderCopy(Order order) throws CloneNotSupportedException;

	public boolean executeOrderById(Integer id);

}
